import Cookies from 'js-cookie'

const TokenKey = 'token'

export default {

  /**
   * 获取Token
   * @returns {*}
   */
   getToken() {
    return Cookies.get(TokenKey);
  },

  /**
   * 设置Token
   * @param token
   * @returns {*}
   */
  setToken(token) {
    return Cookies.set(TokenKey, token);
  },
  /**
   * 清除Token
   * @param token
   * @returns {*}
   */
  removeToken() {
    return Cookies.remove(TokenKey);
  },

  clearStorage () {
    return sessionStorage.clear();
  },

}
